<template>
    <div id="barChart" style="width:100%;height:400px;"></div>

</template>

<script>
import echarts from 'echarts';

export default {
    data() {
        return {

        }
    },
    mounted() {
        let graphicsData = JSON.parse(localStorage.getItem('graphicsData'))
        
        let tradeChart = echarts.init(document.getElementById('barChart'));
        let option = {

            title: {
                text: '手数',
                left: 'center'
            },
            xAxis: {
                type: 'category',
                data: graphicsData.volumeGraph.timeline
            },
            yAxis: {
                type: 'value'
            },
            dataZoom: [  // 滑动缩放
                {
                    // startValue: '11:10:11'
                },
                {
                    type: "inside", // 拖动x轴缩放
                },
            ],
            calculable: true,
            series: [
                {
                    data: graphicsData.volumeGraph.dataDay,
                    type: 'bar',
                    color: 'green',

                }
            ]
        };
        tradeChart.setOption(option);

        window.addEventListener('resize', function () {
            tradeChart.resize();
        })

    },
}
</script>
<style lang="scss" scoped></style>